Repository navigation
Conversation
The flag evaluation hook rebuilt each evaluation's features from the metadata entries: a scan, a HashMap, substrings and a wrapper, on the evaluating thread, for every evaluation of a split with evaluation features. And because the map was new each time, the aggregator had to hash and compare it in full to find the bucket's feature set. Prepare the evaluation features map once with the split, register it under a handle of the current configuration's epoch, and put the handle in the metadata. The hook takes the prepared map when the handle resolves and rebuilds it from the entries otherwise, as after a configuration change. The prepared map caches its hash, so the aggregator finds its feature set by one cached hash and an identity check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Stacked on #13489, whose
SplitFeaturesprepares each split's feature metadata once.With evaluation features on a split,
FlagEvalLoggingHookstill rebuilt the features map on every evaluation, on the evaluating thread: a scan of the metadata, aHashMap, a substring per key and an unmodifiable wrapper. The map was new each time, so the flag-evaluation aggregator also had to hash it and compare it in full to find the bucket's feature set. Profilingscale/variationswith #13609 put thathashCodeat about 19% of the remaining worker time.This PR prepares the evaluation-features map once, with the split, and passes it to the hook by handle:
SplitFeatures.preparealso builds the split's evaluation-features map, with the keys unprefixed and the values exactly as the hook would read them back. It registers the map withEvaluationFeatureHandlesand writes the handle as onelongmetadata entry,__dd_evaluation_features_handle.EvaluationFeatureHandles: a handle is the configuration epoch plus an index into that epoch's table.DDEvaluatorreceives a different configuration, a new epoch starts and the old table is dropped, so only the served configuration's features are retained.Motivation
This takes per-evaluation allocation off the caller for splits with evaluation features. It also removes the aggregator's per-event map hashing and comparison for feature sets.
Additional Notes
Measurement
A benchmark worker ran
ClientEvaluationBenchmark,scale/variations, unique subjects, 4 threads, JDK 21, 3 forks per side. A is the FFE roll-up plus #13609; B is A plus this change.AbstractMap.hashCodewas 16% self time (47% inclusive) on A and is absent from B. The estimated one-core ceiling rises from about 0.15M to about 1.0M events a second; that's extrapolated, not a sustained-load result.scale/splitsandscale/flags: no confirmed change, 1 fork each.🤖 Generated with Claude Code